package com.tencreat.service.mall;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tencreat.common.core.HttpResult;
import com.tencreat.common.core.domain.model.AccountLogin;
import com.tencreat.common.core.domain.model.ReqIdParam;
import com.tencreat.common.core.domain.model.ReqIdsParam;
import com.tencreat.domain.mall.BalanceChange;
import com.tencreat.domain.mall.GoodsRollOrder;
import com.tencreat.domain.mall.vo.AccumulatedVO;

import java.math.BigDecimal;
import java.util.List;

/**
 * 余额变动Service接口
 *
 * @author wangkai
 * @date 2021-11-15
 */
public interface IBalanceChangeService  extends IService<BalanceChange> {
    /**
     * 查询余额变动
     *
     * @param id 余额变动ID
     * @return 余额变动
     */
    public BalanceChange selectBalanceChangeById(ReqIdParam id);

    /**
     * 查询余额变动列表
     *
     * @param balanceChange 余额变动
     * @return 余额变动集合
     */
    public List<BalanceChange> selectBalanceChangeList(BalanceChange balanceChange);

    /**
     * 新增余额变动
     *
     * @param balanceChange 余额变动
     * @return 结果
     */
    public int insertBalanceChange(BalanceChange balanceChange);

    /**
     * 修改余额变动
     *
     * @param balanceChange 余额变动
     * @return 结果
     */
    public int updateBalanceChange(BalanceChange balanceChange);

    /**
     * 批量删除余额变动
     *
     * @param ids 需要删除的余额变动ID
     * @return 结果
     */
    public int deleteBalanceChangeByIds(ReqIdsParam ids);

    /**
     * 删除余额变动信息
     *
     * @param id 余额变动ID
     * @return 结果
     */
    public int deleteBalanceChangeById(ReqIdParam id);

    BigDecimal sumByReferrer(Long uuid);

    AccumulatedVO accumulatedRecharge(AccountLogin accountLogin);

    AccumulatedVO accumulatedConsumer(AccountLogin accountLogin);

    IPage<GoodsRollOrder> goodsRollList(Page<GoodsRollOrder> page, GoodsRollOrder goodsRollOrder);

    BigDecimal rechargeAmount();

    BigDecimal useTotalConsumeRoll();
}
